package com.xl.sst.biz.impl;



import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xl.sst.biz.ShoppingCartBiz;
import com.xl.sst.dao.ShoppingCartDao;
import com.xl.sst.vo.Goods;
import com.xl.sst.vo.ShoppingCart;


@Service
public class ShoppingCartBizImpl implements ShoppingCartBiz{

	@Resource
	private ShoppingCartDao shoppingCartDao;
	public ShoppingCartDao getShoppingCartDao() {
		return shoppingCartDao;
	}
	public void setShoppingCartDao(ShoppingCartDao shoppingCartDao) {
		this.shoppingCartDao = shoppingCartDao;
	}
	//添加商品到购物车
	public Boolean CartAdd(ShoppingCart c) {
		return shoppingCartDao.CartAdd(c)>=1?true:false;
	}
	//修改购物车
	public Boolean CartUpdate(ShoppingCart c) {
		return shoppingCartDao.CartUpdate(c)>=1?true:false;
	}
	//删除购物车里面信息
	public int CartDelete(ShoppingCart c) {
		return shoppingCartDao.CartDelete(c);
	}
	//查询购物车里面信息
	public List<ShoppingCart> CartSelect(ShoppingCart c) {
		return shoppingCartDao.CartSelect(c);
	}
	//根据id获取商品信息
	public Goods selectGoodsById(int id) {		
		return shoppingCartDao.selectGoodsById(id);
	}


}
